function out=auctionA(x,alp,bet,NA,NB,k,lamA)


%temp is x from the constraint as a function of y and \lambda
UB  = (NB*lamA)^bet * (1- k*(1-NB*lamA))^(1-bet);
temp = 1 - UB^(1/bet) / (1-k*x(1))^((1-bet)/bet);
%temp=1-NB*lamA*( (1-k*(1-NB*lamA))/(1-k*x(1)) )^((1-bet)/bet);

% constraints on x
if temp>1
    temp=1;
else end

if temp<0
    temp=0;
else end

%out is the utility function
out=(temp^alp) * (1 - k*(1-x(1)))^(1-alp);

out=-out;